Skip to content

vitest: Fail on console errors and warnings (HMS-10806)#4489

Merged
kingsleyzissou merged 1 commit into
osbuild:mainfrom
regexowl:block-on-err
Jun 5, 2026
Merged

vitest: Fail on console errors and warnings (HMS-10806)#4489
kingsleyzissou merged 1 commit into
osbuild:mainfrom
regexowl:block-on-err

Conversation

@regexowl
Copy link
Copy Markdown
Collaborator

@regexowl regexowl commented Jun 1, 2026

Some changes introduce warning and error console logs in the test output. This will make the test run fail when there's any "mess" and the problems can be fixed in place instead of retroactively when the test output becomes unreadable.

"Maximum update depth exceeded" warning was silences for now and will be revisited later. There's just new act warning and stuff coming in almost every week.

JIRA: HMS-10806

@regexowl
Copy link
Copy Markdown
Collaborator Author

regexowl commented Jun 5, 2026

/jira-epic HMS-10502

@schutzbot schutzbot changed the title vitest: Fail on console errors and warnings vitest: Fail on console errors and warnings (HMS-10806) Jun 5, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.09%. Comparing base (917f914) to head (b1d8cfd).

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4489      +/-   ##
==========================================
+ Coverage   76.05%   76.09%   +0.04%     
==========================================
  Files         225      225              
  Lines        7196     7196              
  Branches     2660     2660              
==========================================
+ Hits         5473     5476       +3     
+ Misses       1482     1479       -3     
  Partials      241      241              

see 1 file with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 917f914...b1d8cfd. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Some changes introduce warning and error console logs in the test output. This will make the test run fail when there's any "mess" and the problems can be fixed in place instead of retroactively when the test output becomes unreadable.

"Maximum update depth exceeded" warning was silences for now and will be revisited later. There's just new act warning and stuff coming in almost every week.
@regexowl regexowl marked this pull request as ready for review June 5, 2026 14:27
@regexowl regexowl requested a review from a team as a code owner June 5, 2026 14:27
Comment thread src/test/setup.ts
},
},
}),
getUser: () =>
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is needed to resolve an error that creeped in while deprecating the old wizard.

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • The global console.error/warn spies in beforeAll/afterAll affect the entire test run; consider scoping them to beforeEach/afterEach or a helper so suites that legitimately assert on console output can opt-in instead of being forced into this behavior.
  • The getUser mock now uses setTimeout(…, 0), which introduces an extra macro-task delay and may make tests more brittle; if you only need asynchronous semantics, using Promise.resolve or queueMicrotask would be simpler and less timing-dependent.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The global console.error/warn spies in beforeAll/afterAll affect the entire test run; consider scoping them to beforeEach/afterEach or a helper so suites that legitimately assert on console output can opt-in instead of being forced into this behavior.
- The getUser mock now uses setTimeout(…, 0), which introduces an extra macro-task delay and may make tests more brittle; if you only need asynchronous semantics, using Promise.resolve or queueMicrotask would be simpler and less timing-dependent.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link
Copy Markdown
Collaborator

@kingsleyzissou kingsleyzissou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@kingsleyzissou kingsleyzissou added this pull request to the merge queue Jun 5, 2026
Merged via the queue into osbuild:main with commit 1eaf2ab Jun 5, 2026
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants